package com.tedu._04mybatis.mapper;

import com.tedu._04mybatis.pojo.Weibo;
import com.tedu._04mybatis.pojo.WeiboVO1;
import com.tedu._04mybatis.pojo.WeiboVO2;
import com.tedu._04mybatis.pojo.WeiboVO3;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {
//    @Insert("INSERT INTO weibo(content,created,user_id) VALUES(#{content},#{created},#{userId})")
    int insertWeibo(Weibo weibo);
//    @Delete("DELETE FROM weibo WHERE id=#{id}")
    int deleteWeibo(Integer id);
//    @Update("UPDATE weibo SET content = #{content} WHERE id = #{id}")
    int updateWeibo(Integer id);
//    @Update("UPDATE weibo SET content = #{content} WHERE id = #{id}")
    int updateWeiboById(Weibo weibo);
    int dynamicUpdateWeibo(Weibo weibo);
    int dynamicDeleteWeibo(Integer[] ids);
    int dynamicDeleteWeibo2(List<Integer> ids);
//
//
//
//    @Select("SELECT id,content,created,user_id userId FROM weibo WHERE id = #{id}")
    Weibo selectWeiboById(Integer id);

//    @Select("SELECT id,content,created,user_id userId FROM weibo")
    List<Weibo> selectAllWeibo();
//    @Select("SELECT content,created FROM weibo WHERE id=#{id}")
    WeiboVO1 selectWeiboVO1ById(Integer id);
//    @Select("SELECT content,created,user_id userId FROM weibo")
    List<WeiboVO2> selectWeiboVO2();

    int countWeibo();

    WeiboVO3 selectWeiboVO3ById();
    List<WeiboVO3> selectAllWeiboVO3();
    WeiboVO3 selectWeiboCommentById();
}
